<form id="approve-form" class="form-horizontal" role="form" data-toggle="validator" method="POST" action="">
    <div class="form-group">
        <label for="c-user-info" class="control-label col-xs-12 col-sm-2">申请用户:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">
                {$row.user.username} ({$row.user.nickname}) - {$row.user.mobile}
            </p>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-classroom-id" class="control-label col-xs-12 col-sm-2">课堂ID:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.classroom_id}</p>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-join-time" class="control-label col-xs-12 col-sm-2">申请时间:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.join_time_text}</p>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-apply-reason" class="control-label col-xs-12 col-sm-2">申请理由:</label>
        <div class="col-xs-12 col-sm-8">
            <p class="form-control-static">{$row.apply_reason}</p>
        </div>
    </div>
    
    <div class="form-group">
        <label for="c-status" class="control-label col-xs-12 col-sm-2">审核结果:</label>
        <div class="col-xs-12 col-sm-8">
            <label class="radio-inline">
                <input type="radio" name="status" value="1" required> 通过
            </label>
            <label class="radio-inline">
                <input type="radio" name="status" value="2" required> 拒绝
            </label>
        </div>
    </div>
    
    <div class="form-group" id="reject-reason-group" style="display: none;">
        <label for="c-reject-reason" class="control-label col-xs-12 col-sm-2">拒绝理由:</label>
        <div class="col-xs-12 col-sm-8">
            <textarea id="c-reject-reason" name="reject_reason" class="form-control" rows="3" placeholder="请填写拒绝理由"></textarea>
        </div>
    </div>
    
    <div class="form-group layer-footer">
        <label class="control-label col-xs-12 col-sm-2"></label>
        <div class="col-xs-12 col-sm-8">
            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
        </div>
    </div>
</form>

<script>
$(function() {
    // 监听审核结果选择
    $('input[name="status"]').change(function() {
        if ($(this).val() == '2') {
            $('#reject-reason-group').show();
            $('#c-reject-reason').attr('required', true);
        } else {
            $('#reject-reason-group').hide();
            $('#c-reject-reason').attr('required', false);
        }
    });
});
</script>